-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: wiggle and silhouette stacks #751
Conversation
formatNonStackedDataSeriesValues and formatStackedDataSeriesValues are always called with a false value of 'scaleToExtent'. Because of this, this commit removes that parameter from the call. It also clean up and refactor some test into integration test
BREAKING CHANGE: PointStyleAccessor and BarStyleAccessor now calls the method with a DataSeriesDatum not with a RawDataSeriesDatum
545cdde
to
6220e49
Compare
Codecov Report
@@ Coverage Diff @@
## master #751 +/- ##
==========================================
+ Coverage 74.33% 74.54% +0.21%
==========================================
Files 269 285 +16
Lines 9303 9578 +275
Branches 1936 1945 +9
==========================================
+ Hits 6915 7140 +225
- Misses 2383 2427 +44
- Partials 5 11 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
the `stackMode` was introduced to apply percentage, wiggle and silhouette offset for stacking charts. BREAKING CHANGE: `stackAsPercentage` prop was replaced by `stackMode` that accept one `StackModes`. fix elastic#715
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good to me, still reviewing behavior and visual screenshot changes. This was lot fewer actual src code changes than I was expecting seeing the +6,975 −3,995
.
After looking at the streamgraph example. I think we should change the tooltip highlighting behavior in a future PR. Maybe this is normal but to me having the geometry point at the top as the area is strange. I feel these chart types are more about the difference in relative height to where the top points are irrelevant. Maybe we just hide points altogether for streamgraphs charts and never highlight the tooltip values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice you changed the extra value appearance on many screenshots. I think we should try to keep sweeping visual changes like this to small PRs. That said, I verified all of the screenshots look ok with the changes, so I'm fine with those changes for this PR.
Some screenshots I couldn't see the difference. For instance the none
type fitting function screenshots like integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png
as well as integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-display-values-in-legend-elements-visually-looks-correct-1-snap.png
. Are these just minor canvas rendering changes?
Exactly, this probably is caused or by the changes to fix the dashed line misaligned, or due to smaller changes on the clipping ranges
My bad I'm sorry for that, whenever something wrong caches my eyes I preferred to fix that as soon as possible to avoid forget it later... I will do better on my next PR |
No worries I feel the same way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# [21.0.0](v20.0.2...v21.0.0) (2020-08-10) ### Bug Fixes * update dep vulnerabilities, minimist and kind-of ([#763](#763)) ([4455281](4455281)) * **legend:** fix color anchor, add action context, fix action padding ([#774](#774)) ([4590a22](4590a22)) * **tooltip:** placement with left/top legends and single bars ([#771](#771)) ([e576b26](e576b26)), closes [#769](#769) [#770](#770) ### Features * streamgraph and fit functions on stacked charts ([#751](#751)) ([268fcc0](268fcc0)), closes [#766](#766) [#715](#715) [#450](#450) ### BREAKING CHANGES * the first parameter of `PointStyleAccessor` and `BarStyleAccessor` callbacks is changed from `RawDataSeriesDatum` to `DataSeriesDatum`. `stackAsPercentage` prop is replaced by `stackMode` that accept one `StackMode`.
🎉 This PR is included in version 21.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [21.0.0](elastic/elastic-charts@v20.0.2...v21.0.0) (2020-08-10) ### Bug Fixes * update dep vulnerabilities, minimist and kind-of ([opensearch-project#763](elastic/elastic-charts#763)) ([843554f](elastic/elastic-charts@843554f)) * **legend:** fix color anchor, add action context, fix action padding ([opensearch-project#774](elastic/elastic-charts#774)) ([262f8d2](elastic/elastic-charts@262f8d2)) * **tooltip:** placement with left/top legends and single bars ([opensearch-project#771](elastic/elastic-charts#771)) ([75533b1](elastic/elastic-charts@75533b1)), closes [opensearch-project#769](elastic/elastic-charts#769) [opensearch-project#770](elastic/elastic-charts#770) ### Features * streamgraph and fit functions on stacked charts ([opensearch-project#751](elastic/elastic-charts#751)) ([6f6a8cb](elastic/elastic-charts@6f6a8cb)), closes [opensearch-project#766](elastic/elastic-charts#766) [opensearch-project#715](elastic/elastic-charts#715) [opensearch-project#450](elastic/elastic-charts#450) ### BREAKING CHANGES * the first parameter of `PointStyleAccessor` and `BarStyleAccessor` callbacks is changed from `RawDataSeriesDatum` to `DataSeriesDatum`. `stackAsPercentage` prop is replaced by `stackMode` that accept one `StackMode`.
Summary
This PR adds the wiggle and silhouette stacks mode as available in vislib.
t is also to fix fit functions for stacked charts #450
Configuring a
stackMode
in a stacked area or bar chart will change the baseline offset used to render each group of stacks.StackMode
are:Applied to a stacked area chart it can be used to stream graphs
close #715
Additional changes
close Fit functions for stacked line and area charts #450
fix Don't display legend extra values when the x scale is ordinal #766
fit
option specified. It renders an empty area segment as in the following screenshotThe PR also adjust how we fit the chart to the data domain: for zero-based charts (bar and area charts) the
fit
option doesn't have effects, thus the changes on the screenshots.The PR finally adjust the clipped ranges for ordinal charts, where the lines where wrongly clipped due to a missing translate call when rendering.
Some tests are converted to functional tests, instead of unit tests.
BREAKING CHANGE:
PointStyleAccessor
andBarStyleAccessor
now calls the method with aDataSeriesDatum
as first argument instead of aRawDataSeriesDatum
stackAsPercentage
prop on BarsSpec and AreaSpec is replaced bystackMode
that accept oneStackMode
.Checklist
src/index.ts
(and stories only import from../src
except for test data & storybook)